package com.emergency.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.emergency.data.entity.Duties;
import com.emergency.data.vo.DutiesVO;
import com.emergency.mapper.DutiesMapper;
import com.emergency.service.DutiesService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

/**
 * (Duties)职称服务实现类
 *
 * @author makejava
 * @since 2020-09-21
 */
@Service
public class DutiesServiceImpl extends ServiceImpl<DutiesMapper, Duties> implements DutiesService {

    @Resource
    private DutiesMapper dutiesMapper;

    @Override
    public List<DutiesVO> getDutiesList() {
        return dutiesMapper.selectList(null).stream().map(c -> {
            DutiesVO vo = new DutiesVO();
            BeanUtil.copyProperties(c, vo);
            return vo;
        }).collect(Collectors.toList());
    }
}
